//
//  MCDiscountPaySectionHeadView.swift
//  StoreManage
//
//  Created by MC on 2017/12/19.
//  Copyright © 2017年 MC. All rights reserved.
//

import UIKit

class MCDiscountPaySectionHeadView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = UIColor.MCGray_light
        self.frame = CGRect.init(x: 0, y: 0, width: 0, height: 130)
        setUpSubViews()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpSubViews() {

        self.addSubview(onlineButton)
        onlineButton.snp.remakeConstraints { (make) ->Void in
            make.left.top.bottom.equalTo(self)
            make.width.equalTo(MCScreenWidth/2)
        }
        
        self.addSubview(offlineButton)
        offlineButton.snp.remakeConstraints { (make) ->Void in
            make.right.top.bottom.equalTo(self)
            make.width.equalTo(MCScreenWidth/2)
        }
        
        self.addSubview(lineView)
        lineView.snp.remakeConstraints { (make) ->Void in
            make.right.left.bottom.equalTo(self)
            make.height.equalTo(1)
        }
    }

    
    lazy var onlineButton: UIButton = {
        let button = UIButton.init(type: UIButtonType.custom)
        button.backgroundColor = UIColor.white
        button.titleLabel?.font = MCFont(14)
        button.setTitle("线上优惠", for: UIControlState.normal)
        button.setTitleColor(UIColor.black, for: UIControlState.normal)
        button.setTitleColor(UIColor.MCAssist, for: UIControlState.selected)
        button.isSelected = true
        return button
    }()
    
    lazy var offlineButton: UIButton = {
        let button = UIButton.init(type: UIButtonType.custom)
        button.backgroundColor = UIColor.white
        button.titleLabel?.font = MCFont(14)
        button.setTitle("扫码买单", for: UIControlState.normal)
        button.setTitleColor(UIColor.black, for: UIControlState.normal)
        button.setTitleColor(UIColor.MCAssist, for: UIControlState.selected)
        return button
    }()
    
    lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.MCGray_light
        return view
    }()
}
